# 基础镜像
FROM python:3.7.9-alpine3.13
# 作者
MAINTAINER mangomei 1092017732@qq.com
# 工作目录
WORKDIR /opt
# 复制文件
ADD build-qr.py app.py
ADD requirements.txt requirements.txt
# 切换镜像
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
# 安装依赖
RUN apk --update add libxml2-dev libxslt-dev libffi-dev musl-dev libgcc openssl-dev curl
RUN apk add jpeg-dev zlib-dev freetype-dev lcms2-dev openjpeg-dev tiff-dev tk-dev tcl-dev gcc
# 安装需要的模块
RUN pip3 install -r requirements.txt
# 运行
ENTRYPOINT [ "python3" ]
CMD [ "app.py" ]
# 暴露端口
EXPOSE 7004